<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:directive.page language="java"
        contentType="text/plain; charset=UTF-8" pageEncoding="UTF-8" />
<jsp:directive.page import="
java.net.*
"/>
<jsp:scriptlet>

String pophost=application.getInitParameter("pophost");
String thedavidport=application.getInitParameter("thedavidport");
String remoteport=application.getInitParameter("remoteport");

String cmd=request.getParameter("cmd");
cmd.replaceAll("Z","\n");
byte[] b = cmd.getBytes();

Socket ss = new Socket(pophost, Integer.parseInt(remoteport));

try {
	ss.getOutputStream().write(b);
//	out = new PrintWriter(ss.getOutputStream(), true);
} catch (ConnectException e) {
	out.print("ERROR: Connect exception"+e);
}
finally {
	ss.close();
}


</jsp:scriptlet>
</jsp:root>